/**
 * 
 */
package com.ch03.UserBuy;
import com.ch03.UserTxn.*;
import com.ch03.Exception.*;
import com.ch03.TransactionTypeEnum.*;
import java.util.*;
import java.text.*;

/**
 * @author Mahesh
 *
 */
public class TestUserBuy {
	
	public void runTestCase1() {
		
	}
	public static void main(String[] args) throws ParseException{
		
		boolean isBuy = false;
		double balance = 600.00;
		
		ArrayList<UserTransaction> tranList = new ArrayList<UserTransaction>();
		UserTransaction tran1 = new UserTransaction(new GregorianCalendar(2009,4,22), 200.00,TransactionType.BUY);
		UserTransaction tran2 = new UserTransaction(new GregorianCalendar(2009,5,22), 100,TransactionType.BUY);
		UserTransaction tran3 = new UserTransaction(new GregorianCalendar(2009,6,22), 300,TransactionType.BUY);
		
		tranList.add(tran1);
		tranList.add(tran2);
		tranList.add(tran3);
		
		UserBuy userbuy = new UserBuy(balance,tranList);
		try {
		 isBuy = userbuy.canBuy(tran1);
		}
		catch (UserByException  uException)
		{
			System.out.println( uException.getMessage());
		}
	}
}
